Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phi 4 multimodal training version 1 ( with limitations ) #1555

Merged
merged 17 commits into from
Mar 22, 2025

Conversation

optas
Copy link
Contributor

@optas optas commented Mar 18, 2025

Description

Adds the necessary changes for SFT training (vision/text-only) with phi-4 in Oumi.

Given that we are using here the vision_language_with_padding we are limited to size batch 1, and we cannot accommodate multi-image training.

Related issues

Towards OPE-1102

Before submitting

  • This PR only changes documentation. (You can ignore the following checks in that case)
  • Did you read the contributor guideline Pull Request guidelines?
  • Did you link the issue(s) related to this PR in the section above?
  • Did you add / update tests where needed?

Reviewers

At least one review from a member of oumi-ai/oumi-staff is required.

@optas optas requested a review from nikg4 March 18, 2025 20:15
@optas optas marked this pull request as ready for review March 20, 2025 21:51
@optas optas changed the title [DRAFT-Not-for-full-review] phi 4 multimodal phi 4 multimodal training version 1 ( with limitations ) Mar 20, 2025
@override
def ignore_features(self) -> list[str]:
"""Returns a list of keys of features to ignore from feeding the model."""
return self._ignore_features if self._ignore_features else []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider returning a shallow copy. Just to make sure that external users can't mutate our member variables.
return copy.copy(self._ignore_features) if self._ignore_features else []

@@ -75,6 +79,7 @@ def __init__(
self._worker_processor.image_processor
)
self._label_ignore_index: Optional[int] = label_ignore_index
self._ignore_features: Optional[list[str]] = ignore_features
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making our own private copy. Just to make sure that external users can't mutate our member variable.

self._ignore_features: Optional[list[str]] =  copy.copy(ignore_features) if ignore_features else [] 

@optas optas merged commit 570afc2 into main Mar 22, 2025
2 checks passed
@optas optas deleted the optas/phi-4-multimodal branch March 22, 2025 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants